var hoverColour = "#FFF";

$(function(){
	$("a.hoverBtn").show("fast", function() {
		$(this).wrap("<div class=\"hoverBtn\">");
		$(this).attr("class", "");
	});
	
	//display the hover div
	$("div.hoverBtn").show("fast", function() {
		//append the background div
		$(this).append("<div></div>");
		
		//get link's size
		var wid = '100%';
		var hei = $(this).children("a").height();
		
		//set div's size
		//$(this).width(wid);
		//$(this).height(hei);
		//$(this).children("div").width(wid);
		//$(this).children("div").height(hei);
		
		//on link hover
		$(this).parent(".testimonial").hover(function(){
			//store initial link color
			if ($(this).children(".quote").children("hoverBtn").children("a").attr("rel") == "") {
				//FIX ME LATER			
			}
		});
		
		
		
		/*//on link hover
		$(this).parent().parent().hover(function(){
			//store initial link colour
			if ($(this).children().children().children("a").attr("rel") == "") {
				$(this).children().children().children("a").attr("rel", $(this).children().children().children("a").css("color"));
			}
			//fade in the background
			$(this).children().children().children("div")
				.stop()
				.css({"display": "inline", "opacity": "1"})
				.fadeIn("fast");
			//fade the colour
			$(this).children().children().children("a").stop()
				.css({"color": $(this).children().children().children("a").attr("rel")})
				.animate({"color": hoverColour}, 350);
		},function(){
			//fade out the background
			$(this).children().children().children("div")
				.stop()
				.fadeOut("slow");
			//fade the colour
			$(this).children().children().children("a").stop()
				.animate({"color": $(this).children().children().children("a").attr("rel")}, 250);
		});*/
	});
	
	//on link hover
	$('.testimonial').hover(function(){
		//store initial link colour
		if ($(this).children().children().children("a").attr("rel") == "") {
			$(this).children().children().children("a").attr("rel", $(this).children().children().children("a").css("color"));
		}
		//fade in the background
		$(this).children().children().children("div")
			.stop()
			.css({"display": "inline", "opacity": "1"})
			.fadeIn("fast");
		//fade the colour
		$(this).children().children().children("a").stop()
			.css({"color": $(this).children().children().children("a").attr("rel")})
			.animate({"color": hoverColour}, 350);
	},function(){
		//fade out the background
		$(this).children().children().children("div")
			.stop()
			.fadeOut("slow");
		//fade the colour
		$(this).children().children().children("a").stop()
			.animate({"color": $(this).children().children().children("a").attr("rel")}, 250);
	});
});
